How to build a Blog with Hexo on Github

##This is the first post of my blog here, and will show how to build it.

##Enviroment: Ubuntu 16.04 + Hexo + Git + Node.js

##Note : change username into real one, supposed your Github id is xxx, replace username with xxx.

1/

1
$ sudo apt-get install node.js

2/

1
$ sudo apt install git-core

3/

1
$ sudo apt install npm

4/

1
$ sudo npm install -g hexo-cli

5/

1
$ cd /home/van/downloads/

you choose a path.

6/

1
$ mkdir TestBlog

7/

1
$ cd TestBlog

8/

1
$ git clone https://github.com/username/username.github.io.git

9/

1
$ hexo init username.github.io

10/

1
2
$ cd username.github.io
$ npm install

11/

1
$ hexo s

type:localhost:4000 in brower,
it should work now, but the http://username.github.io is still 404 error.

12/ open _config.yml and modify as follows:

1
2
3
4
deploy:
type: git
repo: https://github.com/username/username .github.io.git
branch: master

13/

1
2
3
4
5
$ npm install hexo-deployer-git --save
$ hexo clean
$ hexo g
$ hexo d
$ hexo s

now the http://username.github.io should work,
and plz note:in less case , if the port 4000 is occupied,
set $ hexo server -p 5000 or some big number.

14/ change a Theme

1
2
$ cd your-hexo-site
$ git clone https://github.com/iissnan/hexo-theme-next themes/next

modify in _config.yaml:

1
Theme: next

15/ and now you got it. ^^)